package com.aiit.service.impl;

import com.aiit.dao.IUserDao;
import com.aiit.pojo.User;
import com.aiit.service.IUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<IUserDao, User> implements IUserService {
    @Autowired
    IUserDao userDao;
//
//    @Autowired
//    @Lazy
//    IUserService userService;


    @Override
    public List<User> queryAll() {
        return userDao.selectList(null);
    }

    @Override
    public List<User> queryAll1() {
        return userDao.selectList1();
    }

    @Override
    public List<User> queryAll2() {
        return userDao.selectList2();
    }
    @Override
    public List<User> queryAll3() {
        return userDao.selectList3();
    }

    @Override
    public User queryByUsername(String username) {
        return userDao.queryByUsername(username);
    }

    @Override
    public List<User> select(User user) {
        return userDao.select(user);
    }



//    @Override
//    public List<User> selectList(QueryWrapper<User> queryWrapper, User user) {
//        return (List<User>) userService.getOne(new QueryWrapper<User>().eq("username",user.getUsername()));
//    }

    @Override
    public int insert(User user) {

        return userDao.insert(user);
    }

    @Override
    public Boolean insert2(User user) {
        return userDao.insert2(user.getId());
    }


}
